﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.Data.Mapping.Marketing {
    public partial class TokenUpGradeMap
      : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<TokenUpGrade> {
        public TokenUpGradeMap() {
            ToTable("mc_TokenUpGrade", "dbo");

            HasKey(t => t.Id);
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.Amount)
         .HasColumnName("Amount")
          .HasPrecision(18, 6)
         .IsRequired();
            HasRequired(t => t.Merchant)
          .WithMany()
          .HasForeignKey(d => d.MerchantId)
          .WillCascadeOnDelete(false);
            HasRequired(t => t.ApplyMerchant)
          .WithMany()
          .HasForeignKey(d => d.ApplyMerchantId)
          .WillCascadeOnDelete(false);
            HasRequired(t => t.CityCompanyMerchant)
          .WithMany()
          .HasForeignKey(d => d.CityCompanyMerchantId)
          .WillCascadeOnDelete(false);
        }
    }
}
